// 按需引入
<template>
<p>如果您需要按需引入 <code>MessageBox</code>：</p>
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light: #D73A49; --shiki-dark: #F97583;">import</span><span style="--shiki-light: #24292E; --shiki-dark: #E1E4E8;"> { ElMessageBox } </span><span style="--shiki-light: #D73A49; --shiki-dark: #F97583;">from</span><span style="--shiki-light: #032F62; --shiki-dark: #9ECBFF;"> 'element-plus'</span></span></code></pre></div>
<p>那么对应于上述四个全局方法的调用方法依次为：<code>ElMessageBox</code>、<code>ElMessageBox.alert</code>、<code>ElMessageBox.confirm</code> 和 <code>ElMessageBox.prompt</code>。 参数同上所述。</p>
</template>
<style scoped>
@import '../../assets/elementPlusDemo.css'
</style>